@charset "utf-8";
/*
 * 圆角
 * */
@mixin border-radius($size){
    -moz-border-radius: $size;
    -webkit-border-radius: $size;
    border-radius: $size;
}
/*
 * opacity
 * */
@mixin opacity($val :100){
    opacity :$val /100;
    filter :alpha(opacity =$val);
}
/*
 * css3兼容
 * */
@mixin css3($property, $value) {
    @each $prefix in -webkit-,
    -moz-,
    -ms,
    -o-,
    ''{
        #{$prefix}#{$property} :$value;
    }
}

/*
 * 清除浮动
 * */
@mixin clearfix(){
//  @if $legacy-support-for-ie {//兼容ie
//      *zoom: 1;
//  }
    & :before,
    & :after {
        content  :"";
        display :table;
    }
    & :after {
        clear :both;
    }
}

/*
 * 内阴影和外阴影
 *  */
@mixin box-emboss($opcity1,$opcity2){
    box-shadow :white($opcity1) 0 1px 0,inset black($opcity2) 0 1px 0;
}

/*
 * 行高
 * */
@mixin line-height($heightValue :12) {
    line-height :$heightValue +px;
    line-height :(0.125 * $heightValue) +rem
}

/*
 * 隐藏文字
 * */
@mixin hide-text {
    overflow: hidden;
    text-indent: -9000px;
    display :block;
}

/*
 * position定位
 * */
@mixin abs-pos ($top: auto, $right: auto, $bottom: auto, $left: auto) {
    top: $top;
    right: $right;
    bottom: $bottom;
    left: $left;
    position: absolute;
}

/*
 * 使用rem
 * */
@function calculateRem($size: 16) {
    $remSize: $size / 16px;
    @return $remSize * 1rem;
}

@mixin font-size($size) {
    font-size: $size;
    font-size: calculateRem($size);
}
/*
 * 媒体查询
 * */
$breakpoints: (
    'sm': 'only screen and  (min-width: 480px)',
    'md': 'only screen and ( min-width: 768px)',
    'lg': 'only screen and ( min-width: 992px)'
) !default;

@mixin respond-to($breakpoint) {
    $query: map-get($breakpoints, $breakpoint);
      
    @if not $query {
        @error 'No value found for `#{$breakpoint}`. Please make sure it is defined in `$breakpoints` map.';
    }
    @media #{if(type-of($query) == 'string', unquote($query), inspect($query))} {
        @content;
    }
}
/*
 * 长阴影
 * */
@function makelongshadow($color) {
    $val: 0px 0px $color;
    @for $i from 1 through 200 {
        $val: #{$val}, #{$i}px #{$i}px #{$color};
    }
    @return $val;
}

/*
 * 隐藏元素
 * */
%visuallyhidden {
  margin:-1px;
  padding:0;
  width:1px;
  height:1px;
  overflow:hidden;
  clip: rect(0000);
  clip: rect(0,0,0,0);
  position:absolute;
} 

/*
 * 图片替换文本
 * */
@mixin ir {
    background-color: transparent;
    border: 0;
    overflow: hidden;
    @if $legacy-support-for-ie {
        *text-indent: -150%;
    }

    &:before {
        content: "";
        display: block;
        width: 0;
        height: 150%;
    }
}

/*
 * 单行文本溢出
 * */
@mixin singleline-ellipsis($substract:0){//$substract`单元为%
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100% - $substract;
}

/*
 * 最小高度
 * */
@mixin min-height($height){
    min-height: $height;
    height: auto !important;
    @if $legacy-support-for-ie {
        _height: $height;
    }
}

